package lab02.test06;

public class Circle {
    private double radius;
    static final double π = 3.1415926;//定义常量π

    public Circle() {
    }

    public Circle(double radius) {
        this.radius = radius;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public double perimeter() {
        double perimeter = 2 * π * radius;
        return perimeter;
    }

    public double area() {
        double area = π * radius * radius;
        return area;
    }
}
